
cbuffer data :register(c0)
{
	float4x4 world;
	float4x4 worldViewProj;
	float4 lightDirection;
};


Texture2D    diffuse     : register( t0 );

SamplerState samplerDiffuse : register( s0 )
{
    Filter = MIN_MAG_MIP_LINEAR;
    AddressU = Wrap;
    AddressV = Wrap;
};


struct VS_INPUT
{
    float4 position                        : POSITION;
    float2 textureC                        : TEXCOORD0;
    float3 normal                          : NORMAL;
};

struct VS_OUTPUT
{
    float4 position : SV_POSITION;
    float3 normal: NORMAL;
    float2 textureC : TEXCOORD0;
};


VS_OUTPUT VSMain( VS_INPUT input )
{
    VS_OUTPUT Output;

    Output.position = mul(worldViewProj,input.position);
    Output.textureC = input.textureC ;
    Output.normal = mul(world,input.normal);
    return Output;
}

float4 PSMain( VS_OUTPUT input ) : SV_TARGET
{
	return diffuse.Sample(samplerDiffuse,float2(input.textureC.x,input.textureC.y));
}